<template>
  <div>
    <h2>学校姓名:{{ name }}</h2>
    <h2>学校地址:{{ address }}</h2>
  </div>
</template>

<script>
export default {
  name: 'School_C',
  data() {
    return {
      name: '北大',
      address: '北京'
    }
  },
  mounted() {
    this.$bus.$on('getStudentName', this.getStudentName)
  },
  methods: {
    getStudentName(val, ...args) {
      console.log('学生姓名:' + val)
      console.log('其他数据:' + args[0])
      console.log('其他数据:' + args[1])
    }
  },
  beforeDestroy() {
    this.$bus.$off('getStudentName')
  }

}
</script>
<style scoped>


</style>